require("../../assets/css/reset.css");
require("../../assets/css/normalize.css");
require("../../assets/css/basic.css");
require("../../assets/css/property.css");
// 底部导航
require("../../assets/css/navBo.less");
// 字体图标
require("../../assets/fonts/font_hxgcas9slkl/iconfont.css");
require("../../assets/fonts/data/font_4046969_uq86ingo52k/iconfont.css");
require("./mine.less");

const dom = require("../../assets/js/util.js");
let axios = require("../../assets/js/axios");
document.addEventListener("DOMContentLoaded", function () {
	dom.navBo("mine");
	// 跳转
	dom.$("#head").addEventListener("click", function () {
		location.href = "message-alter.html";
	});

	// 数据请求+渲染
	axios.get("/api/user/info").then((res) => {
		console.log(res);
		let data = res.data.data;
		// 个性签名
		dom.$("#tag").textContent = data.sign;
		//用户名
		dom.$("#name").textContent = data.nickName;
		// 头像--拼接
		dom.$(".picture").src = axios.defaults.baseURL + data.imgUrl;
		// 卡路里
		dom.$("#num2").textContent = data.calorie;
		// 时长
		dom.$("#num1").textContent = data.duration;
	});
});
